package com.sdry.web.controller.cb;

import com.sdry.model.cb.TableDataInfo;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

import java.io.Serializable;
import java.util.*;

/**
 * @program: HYWLV_1.0
 * @description: 通用数据处理
 * @author: cb
 * @create: 2019-09-14 21:20
 **/
public class BaseController implements Serializable {

    public static Logger logger = LogManager.getLogger(ReportFormController.class);

    public static Map<String,Object> map = Collections.synchronizedMap(new HashMap<>());

    public TableDataInfo getDataTable(List<?> list,Integer total) {
        TableDataInfo rspData = new TableDataInfo();
        rspData.setTotal(total);
        rspData.setCode(0);
        if (list.size() == 0 || list == null) {
            rspData.setRows(new ArrayList<>());
        }else {
            rspData.setRows(list);
        }
        return rspData;
    }
}
